package cn.itcast.bos.dao.take_delivery;

import domain.take_delivery.Promotion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;

/**
 * Created by Administrator on 2017/7/21/021.
 */
public interface PromotionRepository extends JpaRepository<Promotion, Integer> {

    Promotion findById(Integer id);

    @Query("update Promotion set status = '2' where endDate <? and status ='1'")
    @Modifying
    void updateStatus(Date now);
}
